<template>
  <div>
    <div>
      <label for="">当前余额：</label> <input type="text" disabled="true" v-model="relMoney"/> 元
    </div>
    <br><br>
    <div>
      <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="index()">去充值</el-button>
    </span>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      relMoney: ''
    }
  },
  mounted() {
    this.getMoney()
  },
  methods: {
    getMoney() {
      this.$http({
        url: this.$http.adornUrl('/sys/user/money'),
        method: 'get'
      }).then(({data}) => {
        this.relMoney = data.money.toString()
      })
    },
    index() {
      window.location.href = 'http://127.0.0.1:8080/renren-fast/index'
    }
  }
}
</script>
